package org.intrasearch.spider;

import com.google.inject.Inject;
import com.google.inject.Singleton;

@Singleton
public class SpiderSchedulerImpl implements SpiderScheduler
{
    private final Spider spider;

    @Inject
    public SpiderSchedulerImpl(Spider spider)
    {
        this.spider = spider;
    }

    public void scheduleIndexing(final VirtualFile virtualFile)
    {
        new Thread(new Runnable()
        {
            public void run()
            {
                spider.startIndexing(virtualFile);
            }
        }).start();
    }
}
